@@layout("/common/_container.html"){
<style>
    .CodeMirror, .CodeMirror-scroll {
        min-height: 130px;
        max-height: 200px;
    }

    .CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
        background: none;
    }

    #coverImageBtnId div:nth-child(2){width:100%!important;height:100%!important;}


    .w-e-toolbar {
        flex-wrap: wrap;
        -webkit-box-lines: multiple;
    }

    .w-e-toolbar .w-e-menu:hover{
        z-index: 10002!important;
    }

    .w-e-menu a {
        text-decoration: none;
    }
    <!-- 处罚全屏wangEditor -->
    .fullscreen-editor {
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        left: 0px !important;
        top: 0px !important;
        background-color: white;
        z-index: 9999;
    }

    .fullscreen-editor .w-e-text-container {
        width: 100% !important;
        height: 95% !important;
    }


</style>
<script src="${ctxPath}/static/js/plugins/editor/h5/wangEditor3.1.1.min.js"></script>
<link href="/static/css/article/punish/article_punish.css" rel="stylesheet"/>

<div class="">
    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>发布文章 <small>HTML编辑器，使用 <a href="/article/article/article_publish_md">Markdown编辑器</a></small></h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form id="publishForm" class="form-horizontal form-label-left" novalidate>
                        <input type="hidden" id="isMarkdown" name="isMarkdown" value="false">
                        <input type="hidden" id="id" name="id">
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="title">标题 <span class="required">*</span></label>
                            <div class="col-md-8 col-sm-8 col-xs-12">
                                <input type="text" class="form-control col-md-7 col-xs-12" id="title" name="title"  placeholder="请输入标题"/>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="comment">是否原创</label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <ul class="list-unstyled list-inline">
                                    <li> <input type="radio" class="square" name="original" value="true"> 原创</li>
                                    <li> <input type="radio" class="square" name="original" value="false"> 转载</li>
                                </ul>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="title">文章封面 <span class="required">*</span></label>
                            <div class="col-sm-2">
                                <div id="coverImagePreId">
                                    <div>
                                        <img class="coverImage" width="100px" height="100px">
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-2">
                                <div class="head-scu-btn upload-btn" id="coverImageBtnId">
                                    <i class="fa fa-upload"></i>&nbsp;上传
                                </div>
                            </div>
                            <input type="hidden" id="coverImage"  name="coverImage"/>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" >内容 <span class="required">*</span></label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <div id="editor" style="width: 100%;"></div>
                                <textarea class="form-control col-md-7 col-xs-12" id="content" name="content" style="display: none" required="required"></textarea>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" ><i class="fa fa-refresh fa-fw fa-1x pointer" id="refressType"></i>分类 <span class="required">*</span></label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <div class="input-group">
                                    <select class="form-control" name="typeId" id="typeId">
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" ><i class="fa fa-refresh fa-fw fa-1x pointer" id="refressTag"></i>标签 <span class="required">*</span></label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <ul class="list-unstyled list-inline" id="tag-list" style="line-height: 30px;">
                                </ul>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" >状态 <span class="required">*</span></label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <ul class="list-unstyled list-inline">
                                    <li><input type="radio" class="square" name="status" value="1"> 发布</li>
                                    <li><input type="radio" class="square" name="status" value="2"> 草稿</li>
                                </ul>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="comment">开启评论 <span class="required">*</span></label>
                            <div class="col-md-11 col-sm-11 col-xs-12">
                                <ul class="list-unstyled list-inline">
                                    <li> <input type="radio" class="square" name="comment" id="comment" value="true"> 开启</li>
                                    <li> <input type="radio" class="square" name="comment" id="comment" value="false"> 关闭</li>
                                </ul>
                            </div>
                        </div>
                        <div class="custom-panel">
                            <h2 class="x_title custom-dropdown">其他录入项 <small> - 方便SEO收录</small> <i class="pull-right fa fa-angle-double-up"></i></h2>
                            <div class="custom-container">
                                <div class="item form-group">
                                    <label class="control-label col-md-1 col-sm-1 col-xs-12" >摘要 <span class="required">*</span></label>
                                    <div class="col-md-10 col-sm-10 col-xs-12">
                                        <textarea class="form-control col-md-7 col-xs-12" id="description" name="description" required="required"></textarea>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-1 col-sm-1 col-xs-12" >关键词 <span class="required">*</span></label>
                                    <div class="col-md-10 col-sm-10 col-xs-12">
                                        <textarea class="form-control col-md-7 col-xs-12" id="keywords" name="keywords" required="required"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ln_solid"></div>
                        <div class="form-group">
                            <div class="col-md-10 col-sm-10 col-xs-12">
                                <button type="button" class="btn btn-success publishBtn"><i class="fa fa-pencil"> 发布文章</i></button>
                                <button type="reset" class="btn btn-primary"><i class="fa fa-undo"> 重置</i></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    articleId = '${id!}';
    $(function () {
        //articleId为空的时候进入 也就是只有新增的时候进入
        if(!articleId) {
           Feng.confirm("当前已支持markdown编辑器，去试试？", function () {
                window.location.href="/article/article/article_publish_md";
            }, function () {

            });
        }
        Feng.initWangEditor({
            id: "editor",
            contentId: "content",
            uploadUrl: "/toolapi/upload2AliossForMd",
            uploadFileName: "file"
        });
    });
</script>
<script type="text/javascript" src="/static/modular/article/article/publish-article.js"></script>
@@}
